import reshandler from 'services/response-handler'
/*
 * 获得会员等级
 */
function makeData(response) {
  return Object.assign({}, response, {
    "name": response.name || "", // 姓名
    "gemder": response.gemder || "0", // 性别
    "rank": response.rank || "", // 会员等级
    "point": response.point || "",
    "ingegralDesc": response.ingegralDesc || "",
    "bean": response.bean || "0",
    "beanDesc": response.beanDesc || "",
    "signDetail": response.signDetail || [],
    "integralDetails": response.integralDetails || [],
    "ranks": response.ranks || [],
  })
}
export default function (params, success, fail) {
  // request 
  params = Object.assign({}, params, {
    methodName: "QueryUserRankInfo",
  })

  // invoke
  this.$.get(params)
    .then(reshandler.success(success, fail, makeData), reshandler.error(fail))
}
